import { request } from '@/utils/request';

/** 待办 */
export const queryTaskList = (query) => {
  return request<{ query: any }>({
    url: `/engine/task/my/todo/page`,
    method: 'GET',
    query,
  });
};

/** 发起 */
export const queryApplyList = (query) => {
  return request<{ query: any }>({
    url: `/engine/process-instance/my/apply/page`,
    method: 'GET',
    query,
  });
};
/** 抄送 */
export const queryCopyList = (query) => {
  return request<{ query: any }>({
    url: `/engine/copy-record/my/copy/page`,
    method: 'GET',
    query,
  });
};
/** 已办 */
export const queryDoneList = (query) => {
  return request<{ query: any }>({
    url: `/engine/task/my/done/page`,
    method: 'GET',
    query,
  });
};
/** 抄送点击查看请求的接口 */
export const copyToDetailBefore = (id) => {
  return request<{ query: any }>({
    url: `engine/copy-record/read/${id}`,
    method: 'PUT',
  });
};

//  防止创建多个同名文件 暂时放在这个文件下
// 获取部门列表
export const queryDeptList = (query?) => {
  return request<{ query: any }>({
    url: `/admin/dept/tree`,
    method: 'GET',
    query: query || {},
  });
};

// 获取全部部门列表
export const queryDeptAllList = (query) => {
  return request<{ query: any }>({
    url: `/admin/dept/tree`,
    method: 'GET',
    query: query || {},
  });
};
// 获取用户
export const queryUserList = (query?) => {
  return request<{ query: any }>({
    url: `/admin/hrPerson/page`,
    method: 'GET',
    query: query || {},
  });
};
